POV-Ray : Newsgroups : povray.advanced-users : vlength( ) : Re: vlength( ) Server Time
30 Jul 2024 02:23:32 EDT (-0400)
  Re: vlength( )  
From: SamuelT
Date: 9 Jun 2000 01:05:37
Message: <39407BC0.6E1D4081@aol.com>
So, is there a way to get a perfect average from a vector number? I'm
experimenting with eval_pigment and it has become necessary to convert vectors
to floats.

Chris Colefax wrote:

> SamuelT <STB### [at] aolcom> wrote:
> > Does anybody know how vlength converts vectors to floats? I've use it,
> > but I'm interested in knowing what the output is. Does it average the
> > vector numbers to create one float? Thanks in advance.
>
> I think you'll find it uses something more Pythagorean than a simple
> average: the formula for the length of a vector (as shown in the POV-Ray
> docs) is the square root of the sum of the squares of each of the vector's
> components, ie:
>
>    sqrt (vdot(V, V))
>
> which equals:
>
>    sqrt (V.x*V.x + V.y*V.y + V.z*V.z)
>
> in the case, obviously, of a three dimensional vector.

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit my isosurface tutorial at http://members.aol.com/stbenge


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.